package experiment8;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class No_3 {
    public static void main(String []args){
        List<memory_boom> list=new ArrayList<>();
        while (true){
            try {
                list.add(new memory_boom());
            }
            catch (OutOfMemoryError error){
                System.out.println("发生了内存溢出错误");
                System.out.println("系统已自动退出");
                System.exit(0);
            }
        }
    }
}
class memory_boom{
    //内存爆炸吧
    public memory_boom(){
    }
}